using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Serilog;

namespace WebapiTemplate.Infrastructure
{
    public  static class ConfigureLogProvider
    {
        public static void ConfigureLog(this WebApplicationBuilder builder)
        {
            //这里不需要导入IConfiguration configuration是我万万没想到的，但是能获取到appsettings.json 文件Serilog的配置信息
            builder.Host.UseSerilog((context,configuration) => configuration
                    .ReadFrom.Configuration(context.Configuration)
                    .WriteTo.Console());
        }
    }
}